/**
 * 应用主题配置
 */

/**
 * 颜色系统
 */
export const colors = {
    // 主要颜色
    primary: {
        light: '#4C83FF',
        main: '#2962FF',
        dark: '#0039CB',
        contrastText: '#FFFFFF'
    },
    // 次要颜色
    secondary: {
        light: '#62EFFF',
        main: '#00B8D4',
        dark: '#0088A3',
        contrastText: '#000000'
    },
    // 功能色
    success: {
        light: '#80E27E',
        main: '#4CAF50',
        dark: '#087F23',
        contrastText: '#FFFFFF'
    },
    error: {
        light: '#FF6659',
        main: '#D32F2F',
        dark: '#9A0007',
        contrastText: '#FFFFFF'
    },
    warning: {
        light: '#FFD54F',
        main: '#FFC107',
        dark: '#C79100',
        contrastText: '#000000'
    },
    info: {
        light: '#64B5F6',
        main: '#2196F3',
        dark: '#0069C0',
        contrastText: '#FFFFFF'
    },
    // 中性色
    gray: {
        50: '#FAFAFA',
        100: '#F5F5F5',
        200: '#EEEEEE',
        300: '#E0E0E0',
        400: '#BDBDBD',
        500: '#9E9E9E',
        600: '#757575',
        700: '#616161',
        800: '#424242',
        900: '#212121'
    },
    // 背景色
    background: {
        default: '#FFFFFF',
        paper: '#F5F5F5',
        disabled: '#E0E0E0'
    },
    // 文本色
    text: {
        primary: '#212121',
        secondary: '#757575',
        disabled: '#9E9E9E',
        hint: '#9E9E9E'
    },
    // 分割线
    divider: '#E0E0E0',
    // 黑白
    common: {
        black: '#000000',
        white: '#FFFFFF'
    }
};

/**
 * 字体系统
 */
export const typography = {
    fontFamily: {
        base: 'PingFang SC, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif',
        code: 'SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace'
    },
    fontWeight: {
        light: 300,
        regular: 400,
        medium: 500,
        bold: 700
    },
    fontSize: {
        xs: 12,
        sm: 14,
        md: 16,
        lg: 18,
        xl: 20,
        xxl: 24,
        xxxl: 30,
        display: 36
    },
    lineHeight: {
        xs: 1.2,
        sm: 1.4,
        md: 1.6,
        lg: 1.8
    }
};

/**
 * 间距系统
 */
export const spacing = {
    unit: 8,
    xxs: 2,   // 2px
    xs: 4,    // 4px
    sm: 8,    // 8px
    md: 16,   // 16px
    lg: 24,   // 24px
    xl: 32,   // 32px
    xxl: 48,  // 48px
    xxxl: 64  // 64px
};

/**
 * 阴影系统
 */
export const shadows = {
    none: 'none',
    xs: '0 1px 2px rgba(0, 0, 0, 0.05)',
    sm: '0 2px 4px rgba(0, 0, 0, 0.1)',
    md: '0 4px 8px rgba(0, 0, 0, 0.1)',
    lg: '0 8px 16px rgba(0, 0, 0, 0.1)',
    xl: '0 16px 24px rgba(0, 0, 0, 0.1)',
    xxl: '0 24px 32px rgba(0, 0, 0, 0.1)'
};

/**
 * 圆角系统
 */
export const borderRadius = {
    none: 0,
    xs: 2,
    sm: 4,
    md: 8,
    lg: 12,
    xl: 16,
    round: '50%'
};

/**
 * 过渡系统
 */
export const transitions = {
    duration: {
        shortest: 150,
        short: 200,
        medium: 300,
        long: 375
    },
    easing: {
        easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
        easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
        easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
        sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
    }
};

/**
 * 断点系统
 */
export const breakpoints = {
    values: {
        xs: 0,     // 手机竖屏
        sm: 600,   // 手机横屏
        md: 960,   // 平板竖屏
        lg: 1280,  // 平板横屏/笔记本
        xl: 1920   // 桌面大屏
    },
    up: (key: keyof typeof breakpoints.values) => `@media (min-width: ${breakpoints.values[key]}px)`,
    down: (key: keyof typeof breakpoints.values) => {
        const value = breakpoints.values[key];
        return `@media (max-width: ${value - 0.05}px)`;
    },
    between: (start: keyof typeof breakpoints.values, end: keyof typeof breakpoints.values) => {
        return `@media (min-width: ${breakpoints.values[start]}px) and (max-width: ${breakpoints.values[end] - 0.05}px)`;
    }
};

/**
 * 全局Z轴层级
 */
export const zIndex = {
    appBar: 1100,
    drawer: 1200,
    modal: 1300,
    snackbar: 1400,
    tooltip: 1500,
    dropdown: 1050
};

/**
 * 全局主题配置
 */
const theme = {
    colors,
    typography,
    spacing,
    shadows,
    borderRadius,
    transitions,
    breakpoints,
    zIndex
};

export default theme; 